/***
 * 信息发布管理
 */
import iViewTheme from 'iview-layout-themes'
const axios = iViewTheme.util.apiRequest

/***
 * 文章管理
 */

// 文章列表（分页）
export const getArticleList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/getArticleList',
    data: data,
    type: 'post'
  })
}
// 类别列表
export const getArticleCategoryList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/getArticleCategoryList',
    data: data,
    type: 'get'
  })
}
// 文章删除
export const deleteArticle = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/deleteArticle',
    data: data,
    type: 'post'
  })
}
// 文章批量删除
export const deleteArticlePl = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/deleteArticlePl',
    data: data,
    type: 'post'
  })
}
// 文章添加&修改
export const saveArticle = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/saveArticle',
    data: data,
    type: 'post'
  })
}
// 文章修改状态
export const updateIsopen = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/updateIsopen',
    data: data,
    type: 'post'
  })
}

/***
 * 类别管理
 */

// 类别列表（分页）
export const getCategoryList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/getCategoryList',
    data: data,
    type: 'post'
  })
}
// 类别删除
export const deleteCategory = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/deleteCategory',
    data: data,
    type: 'post'
  })
}
// 类别批量删除
export const deleteCategoryPl = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/deleteCategoryPl',
    data: data,
    type: 'post'
  })
}
// 类别添加&修改
export const saveCategory = (data) => {
  return axios.request({
    url: '/api/as/ctcm/article/saveCategory',
    data: data,
    type: 'post'
  })
}
